/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - For2
 * <p>Powered by webrx On 2021-11-25 10:15:37
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class For2 {
    public static void main(String[] args) {
        for (int i = 1; i <= 10; i++) {
            System.out.printf("%02d  ", i);
        }
        System.out.println();
        //计算1+2+3+..+100 = ?
        int sum = 0;
        for (int i = 1; i <= 100; i++) sum += i;
        System.out.printf("1+2+3+...+100 = %d%n", sum);
        //1 + 100
        //2 + 99
        //50 + 51 50 个 101
        System.out.println(101 * 50);
    }
}
